<link rel="stylesheet"
	  href="./app/lib/datatables/media/css/dataTables.bootstrap.css">
<div ng-controller="advertisecontent as gt">

<section class="content-header">
	<h1>
		{{title}}<small></small>
	</h1>
</section>
<section class="content">
	<div class="box box-default">
		<div class="col-md-12">
			<div class="box-body" >
				<alertdanger></alertdanger>
				<alertsuccess></alertsuccess>
				<form role="form" >
					<div class="box-body">
						<div class="form-group" ng-init="findalladvs();">
							<label>请选择广告</label> <select
														ng-model="selectedadv"
														ng-options="gs.title for gs in advselect"
														class="form-control select2" style="width: 100%;">
							<option ng－value="-1">--请选择--</option>
						</select>
						</div>
						<div class="form-group">
							<label>
								<input type="radio" ng-model="type" ng-value="2" class="flat-red" ng-change="advtypechange();"  ng-checked="true">
								关联专题
							</label>
							<label>

								<input type="radio" ng-model="type" ng-value="1" class="flat-red" ng-change="advtypechange();">
								关联货物
							</label>

						</div>

						<div  ng-show="gspshow" class="form-group" ng-init="findallgoodsspecial();">
							<label>请选择专题</label> <select
								ng-model="selectedgsp"
								ng-options="gs.title for gs in gspselect"
								class="form-control select2" style="width: 100%;">
							<option ng－value="-1">--请选择--</option>
						</select>
						</div>


						<div ng-show="productshow">
							<div class="form-group" ng-init="findallgoodstype();">
								<label>商品类型</label> <select
															ng-model="selectedgoodstype"
															ng-options="gs.name for gs in goodstypeselect"
															class="form-control select2" style="width: 100%;">
								<option ng－value="-1">--请选择--</option>
							</select>
							</div>
							<div class="box box-success">
								<div class="box-header with-border">
									<h3 class="box-title">搜索货物</h3>
								</div>
								<div class="box-body">
									<div class="form-group">
										<div class="col-md-3">
											<label>货物名称</label>
											<input maxlength="20"
												   ng-model="productname" class="form-control" type="text"
												   placeholder="请输入货物名称" value="" />
										</div>
										<div class="col-md-3">
											<label>货号</label>
											<input maxlength="20"
												   ng-model="psn" class="form-control" type="text"
												   placeholder="请输入货号" value="" />
										</div>
									</div>

								</div>
								<div class="box-body">
									<div class="form-group">
										<button ng-click="searchdataTableCustom();" class="btn btn-block btn-success btn-sm">检索</button>
									</div>
								</div>
							</div>
							<div class="col-xs-12">
								<div class="box">
									<div class="box-header"></div>
									<div class="box-body" >
										<table datatable="" dt-options="gt.dtOptions"
											   dt-columns="gt.dtColumns"
											   dt-instance="gt.dtInstance"
											   class="table table-striped table-bordered"></table>
									</div>
								</div>
							</div>
							<div class="box-body" >
								<div class="form-group">
									<div class="col-md-12">
										<div class="box box-widget widget-user">
											<div class="widget-user-header bg-green">
												{{selectedproducts.productname}}

											</div>
											<div class="widget-user-image">

												<img class="img-circle" src="{{selectedproducts.mainimg}}" alt="img">
											</div>
											<div class="box-footer">
												<div class="row">
													<div class="col-sm-4 border-right">
														<div class="description-block">
															<h5 class="description-header">{{selectedproducts.cost|currency:"¥"}}</h5>
															<span class="description-text">成本价</span>
														</div>
													</div>
													<div class="col-sm-4 border-right">
														<div class="description-block">
															<h5 class="description-header">{{selectedproducts.memberprice|currency:"¥"}}</h5>
															<span class="description-text">会员价</span>
														</div>
													</div>
													<div class="col-sm-4">
														<div class="description-block">
															<h5 class="description-header">{{at.stock|number}}</h5>
															<span class="description-text">库存</span>
														</div>
													</div>
												</div>
												<button ng-click="removeselectproduct()">删除</button>
											</div>
										</div>
									</div>
								</div>

							</div>
						</div>


						<div class="form-group">
		                    <label>
		                      <input type="radio" ng-model="status" ng-value="1" class="flat-red" ng-checked="true">
		                      启用
		                    </label>
		                    <label>
		                      <input type="radio"  ng-model="status" ng-value="0" class="flat-red">
		                      禁用
		                    </label>
		               
	                  	</div>
					</div>
					<div class="box-footer">
						<button ng-show="savebtn.show"type="button" class="btn btn-primary" ng-click="save();">保存</button>
						<button ng-show="updatebtn.show" type="button" class="btn btn-primary" ng-click="update();">更新</button>
					</div>
				</form>
			</div>
		</div>
		<div class="box-footer"></div>
	</div>
</section>
</div>
